//
//  ZSY_BaseTableView.m
//  ZSY_BreadTrip
//
//  Created by 张诗宇 on 16/1/5.
//  Copyright © 2016年 张诗宇. All rights reserved.
//

#import "ZSY_BaseTableView.h"

@implementation ZSY_BaseTableView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/


- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style {
    
    self = [super initWithFrame:frame style:style];
    
    if (self) {
        
//        CGRect frame = [[UIScreen mainScreen] bounds];
//        frame.size.height -= 84;
//        self.frame = frame;
        
        self.backgroundColor = WHITE_COLOR;
        
        
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeColor:) name:@"changeColor" object:nil];
        
        NSString *states = [[NSUserDefaults standardUserDefaults] objectForKey:@"night"];
        
        if ([states isEqualToString:@"yes"]) {
            //黑夜状态
            self.backgroundColor = NIGHT_COLOR;
        }
    
    }
    return self;
}
    
-(void)changeColor:(NSNotification *)notification{
        
        UIColor *color = [notification object];
        self.backgroundColor = color;
}


@end
